# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpec do
  @moduledoc """
  Represents a single parameter to optimize.

  ## Attributes

  *   `categoricalValueSpec` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpecCategoricalValueSpec.t`, *default:* `nil`) - The value spec for a 'CATEGORICAL' parameter.
  *   `conditionalParameterSpecs` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpec.t)`, *default:* `nil`) - A conditional parameter node is active if the parameter's value matches the conditional node's parent_value_condition. If two items in conditional_parameter_specs have the same name, they must have disjoint parent_value_condition.
  *   `discreteValueSpec` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpecDiscreteValueSpec.t`, *default:* `nil`) - The value spec for a 'DISCRETE' parameter.
  *   `doubleValueSpec` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpecDoubleValueSpec.t`, *default:* `nil`) - The value spec for a 'DOUBLE' parameter.
  *   `integerValueSpec` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpecIntegerValueSpec.t`, *default:* `nil`) - The value spec for an 'INTEGER' parameter.
  *   `parameterId` (*type:* `String.t`, *default:* `nil`) - Required. The ID of the parameter. Must not contain whitespaces and must be unique amongst all ParameterSpecs.
  *   `scaleType` (*type:* `String.t`, *default:* `nil`) - How the parameter should be scaled. Leave unset for `CATEGORICAL` parameters.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :categoricalValueSpec =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpecCategoricalValueSpec.t()
            | nil,
          :conditionalParameterSpecs =>
            list(
              GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpec.t()
            )
            | nil,
          :discreteValueSpec =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpecDiscreteValueSpec.t()
            | nil,
          :doubleValueSpec =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpecDoubleValueSpec.t()
            | nil,
          :integerValueSpec =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpecIntegerValueSpec.t()
            | nil,
          :parameterId => String.t() | nil,
          :scaleType => String.t() | nil
        }

  field(:categoricalValueSpec,
    as:
      GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpecCategoricalValueSpec
  )

  field(:conditionalParameterSpecs,
    as:
      GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpecConditionalParameterSpec,
    type: :list
  )

  field(:discreteValueSpec,
    as:
      GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpecDiscreteValueSpec
  )

  field(:doubleValueSpec,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpecDoubleValueSpec
  )

  field(:integerValueSpec,
    as:
      GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpecIntegerValueSpec
  )

  field(:parameterId)
  field(:scaleType)
end

defimpl Poison.Decoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpec do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpec.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1StudySpecParameterSpec do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
